﻿using SymulatorEthernetWPF.SimObjects.Devices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace SymulatorEthernetWPF.SimObjects.Layers.DataLink
{
    [Serializable]
    public class Ethernet: ISerializable
    {
        public MacAdress destination;
        public MacAdress source;
        public Ethernet(MacAdress destination, MacAdress source)
        {
            this.destination = destination;
            this.source = source;
        }

        public Ethernet(SerializationInfo info, StreamingContext context)
        {
            destination = (MacAdress)info.GetValue("destination", typeof(MacAdress));
            source = (MacAdress)info.GetValue("source", typeof(MacAdress));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("destination", destination);
            info.AddValue("source", source);
        }

    }
}
